package relation_table

// 一对多
type User2 struct {
	Id      int
	Name    string
	Age     int
	Addr    string    // 包含
	Article []Article `gorm:"ForeignKey:UId;AssociationForeignKey:Id"`
}

type Article struct {
	Id      int
	Title   string
	Content string
	Desc    string
	//User2   []User2 `gorm:"ForeignKey:UId;AssociationForeignKey:Id"` // 一对多外键在多的一方    属于
	// 外键
	UId int
}
